Skip to content

feat(UI): enhance CodeContent with line copy functionality and toolbar#1100

Merged
benjamin-747 merged 1 commit into
gitmono-dev:mainfrom
yumeowo:main
Jun 6, 2025
Merged

feat(UI): enhance CodeContent with line copy functionality and toolbar#1100
benjamin-747 merged 1 commit into
gitmono-dev:mainfrom
yumeowo:main

Conversation

@yumeowo

@yumeowo yumeowo commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

#1071
修改样式,完善工具栏,添加源码查看和下载,行高亮,复制代码功能

@vercel

vercel Bot commented Jun 6, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 3:28am

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the code viewer with a new toolbar (Raw, Copy, Download, Edit), per-line selection and copy functionality, and refines styling for both the code pane and breadcrumb.

  • Refactor Layout styles in BlobPage, passing path to CodeContent.
  • Introduce a toolbar and single-line copy in CodeContent.
  • Tweak breadcrumb padding and separator spacing.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
moon/apps/web/pages/[org]/code/blob/[...path].tsx Updated layout styles; passed path prop into CodeContent.
moon/apps/web/components/CodeView/TreeView/BreadCrumb.tsx Adjusted container padding and removed horizontal margin around /.
moon/apps/web/components/CodeView/BlobView/CodeContent.tsx Added toolbar (Raw/Copy/Download/Edit), line highlighting/copy, and updated component signature.
moon/apps/web/components/CodeView/BlobView/CodeContent.module.css Refined toolbar/button styles and code line number spacing.
Comments suppressed due to low confidence (3)

moon/apps/web/components/CodeView/BlobView/CodeContent.tsx:187

  • [nitpick] The inner i in line.map(i => i.content) shadows the outer loop index. Rename it to a more descriptive name like token to avoid confusion.
handleCopyLine(line.map(i=>i.content).join(''))

moon/apps/web/pages/[org]/code/blob/[...path].tsx:82

  • You removed the style={breadStyle} prop from the breadcrumb <Layout>, which breaks its intended sizing and background. Restore or replace the style to maintain the original look.
<Layout>

moon/apps/web/components/CodeView/TreeView/BreadCrumb.tsx:29

  • [nitpick] Removing the mx-1 class eliminates spacing around the separator. Consider re-adding horizontal margin to keep consistent breadcrumb spacing.
<span className="text-gray-400">/</span>

Comment thread moon/apps/web/components/CodeView/BlobView/CodeContent.tsx
Comment thread moon/apps/web/components/CodeView/BlobView/CodeContent.tsx
@benjamin-747
benjamin-747 added this pull request to the merge queue Jun 6, 2025
Merged via the queue into gitmono-dev:main with commit 0b3cd96 Jun 6, 2025
5 checks passed
@benjamin-747

Copy link
Copy Markdown
Collaborator

link #1093

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants